<script language="javascript" type="text/javascript" src="p_ebd/valida_form.js"></script>
<?php 
	$user = $_SESSION['usuario'];
	include "p_usuario/valida_credenciais.php";
	$valCr = new valida_credenciais();
	
	$nivel = array(1,2,4);
	if(!($valCr->validar($nivel))){
		header('Location: index.php?p=denied');
	}
?>
<div class="form">

	<div class="row">
		<div class="col-md-12">
			<div class="page-header">
				<h2>Registrar Classe da Escola Dominical</h2>
			</div>
		</div>
	</div>
	<div class="row">
	<div class="col-md-3">
			<div class="actions">
				<div class="panel panel-default">
					<div class="panel-heading"><h5>Op&ccedil&otildees</h5></div>
						<div class="panel-body">
							<ul class="nav nav-pills nav-stacked">
								<li><a href="index.php?p=classes" >Classes</a></li>
								<li><a href="index.php?p=ebd">Lista de EBD's</a></li>
							</ul>
						</div><!-- end body -->
				</div><!-- end panel -->
				</div>			
		</div><!-- end col md 3 -->
		<div class="col-md-9">
		<!-- HEAD DE FORMULÃ�RIO -->
		<div class="panel panel-default">
			<div class="panel-heading"><h5>Formul&aacuterio de Registro</h5></div>
			<div class="panel-body">
			<!-- FORMULÃ�RIO -->
			<form  method="post" name="form1" action="p_ebd/salvar_classe.php">
				<div class="row">	
					<div class="form-group col-md-7">
						<label for="classe" >Nome da Classe ou Sala de Aula (<span class="text-danger">*</span>)</label>
    					<input type="text" class="form-control" id="classe" name="classe" >
					</div>
					<div class="form-group col-md-5">
						<label for="ebd">Escola Bíblica Dominical (<span class="text-danger">*</span>)</label>
    					<select name="ebd" id="ebd" class="form-control">
		          			<option value="selecione">Selecione...</option>
		          			<?php
									//require "banco/ConexaoBanco.php";
									$query = mysql_query("SELECT ebd.id, ebd.nome_ebd FROM ebd");
									while($lista = mysql_fetch_array($query)) { ?> 
									<option value="<?php echo $lista['id']; ?>"><?php echo $lista['nome_ebd']; ?></option>
								<?php } ?>
		          		</select>
		          	</div>
				</div>
				<div class="row">
					<div class="form-group col-md-7">
						<label for="licao">Lição Bíblica (<span class="text-danger">*</span>)</label>
    					<select name="licao" id="licao" class="form-control">
		          			<option value="selecione">Selecione...</option>
		          			<?php
									//require "banco/ConexaoBanco.php";
									$query = mysql_query("SELECT licoes.id, licoes.licao, tipo FROM licoes");
									while($lista = mysql_fetch_array($query)) { ?> 
									<option value="<?php echo $lista['id']; ?>"><?php echo $lista['licao'].' - '.$lista['tipo']; ?></option>
								<?php } ?>
		          		</select>
		          	</div>
		          	<div class="form-group col-md-5">
						<label for="professor">Professor (<span class="text-danger">*</span>)</label>
    					<select name="professor" id="professor" class="form-control">
		          			<option value="selecione">Selecione...</option>
		          			<?php
									//require "banco/ConexaoBanco.php";
									$query = mysql_query("SELECT id, membro, tipo_membro_id FROM membros WHERE membros.tipo_membro_id = 7");
									while($lista = mysql_fetch_array($query)) { ?> 
									<option value="<?php echo $lista['id']; ?>"><?php echo $lista['membro']; ?></option>
								<?php } ?>
		          		</select>
		          	</div>
				</div>
				<div class="row">
					<div class="form-group col-md-12">
						<label for="desc">Descrição da Classe</label>
    					<textarea class="form-control" id="desc" name="desc" rows="4"></textarea>
    					<input type="hidden" name="user" value="<?php echo $user[0];?>">
					</div>
				
				</div>
				<div class="row">
					<div class="form-group col-md-2">
						<input type="submit" value="Salvar" class="btn btn-default " name="enviar" onclick="return valida_classe()" >
					</div>
				</div>
			</form>
			</div>
		</div>

		</div><!-- end col md 12 -->
	</div><!-- end row -->
</div>
			